package com.itheima.d08_decorator;

import com.itheima.d08_decorator.decorator.BlueBuf;
import com.itheima.d08_decorator.decorator.DrogBuf;
import com.itheima.d08_decorator.decorator.RedBuf;

import java.io.FileNotFoundException;


/**
 * 目标：了解装饰者设计模式
 */
public class Test {

    public static void main(String[] args) throws FileNotFoundException {
        //需求：LOL英雄（RedBuf/BlueBuf/DrogBuf）
        //被装饰者： 英雄
        HeroStatusBase jianSh = new Hero();

        System.out.println("英雄伤害："+jianSh.nowHurt());
        jianSh.nowStatus();

        System.out.println();
        System.out.println("\t\t打红buf... ...");
        //装饰者：红buf
        jianSh = new RedBuf(jianSh);
        System.out.println("英雄伤害："+jianSh.nowHurt());
        jianSh.nowStatus();

        System.out.println();
        System.out.println("\t\t打蓝buf... ...");
        //装饰者：蓝buf
        jianSh = new BlueBuf(jianSh);
        System.out.println("英雄伤害："+jianSh.nowHurt());
        jianSh.nowStatus();


        System.out.println();
        System.out.println("\t\t打红buf... ...");
        //装饰者：红buf
        jianSh = new RedBuf(jianSh);
        System.out.println("英雄伤害："+jianSh.nowHurt());
        jianSh.nowStatus();

        System.out.println();
        System.out.println("\t\t打蓝buf... ...");
        //装饰者：蓝buf
        jianSh = new BlueBuf(jianSh);
        System.out.println("英雄伤害："+jianSh.nowHurt());
        jianSh.nowStatus();



        System.out.println();
        System.out.println("\t\t打蓝buf... ...");
        //装饰者：蓝buf
        jianSh = new DrogBuf(jianSh);
        System.out.println("英雄伤害："+jianSh.nowHurt());
        jianSh.nowStatus();
    }
}
